package com.imooc.hadoop.mapreduce.sort;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @program: hadoop_db
 * @description: SortReducer
 * @author: zengchen
 * @create: 2021-03-29 19:54
 **/
public class SortReducer extends Reducer<SortWritable, NullWritable, Text, NullWritable> {
    @Override
    protected void reduce(SortWritable key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        context.write(new Text(key.getFirst() + "->" + key.getSecond()), NullWritable.get());
    }
}
